<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
	<%@ include file= "_meta.jsp"%>
	<link title="style1" rel="stylesheet" href="${pageContext.request.contextPath}/css/add_course.css" type="text/css" />
</head>
<body>

<%@ include file= "_menu.jsp"%>
<%@ include file= "_header.jsp"%>
<div class="form_content">
	<div id="test">

		<fieldset>
			<legend>录入教师</legend>

			<div class="form-row">
				<div class="field-label"><label for="tname">教师姓名</label>:</div>
				<div class="field-widget"><input name="tname" id="tname" class="required" title="Enter your name"/>
				</div>
			</div>

			<div class="form-row">
				<div class="field-label"><label for="tid">教师号</label>:</div>
				<div class="field-widget"><input name="tid" id="tid" class="required validate-email"
												 title="Enter your name"/></div>
			</div>


			<%--<div class="form-row">
				<div class="field-label"><label for="ttel">联系方式</label>:</div>
				<div class="field-widget"><input name="ttel" id="ttel" class="required validate-password"
												 title="Enter a password greater than 6 characters"/></div>
			</div>--%>


		</fieldset>

		<input type="submit" class="submit" value="提交"/> <input class="reset" type="button" value="重置"
																onclick="valid.reset(); return false"/>
	</div>
</div>
<%@ include file="_footer.jsp"%>
<script>

    (function () {
        function sendReq() {
            var msg={};
            var tname=$('#tname').val();
            var tid=$('#tid').val();

            msg.tname=tname;
            msg.tid=tid;

            console.log(msg);
            $.ajax({
                url:'${pageContext.request.contextPath}/admin/add_teacher',
                data:msg,
                dataType : "text",
                success:function (data) {
                    if(data=="success"){
                        alert("添加成功!")
                    }
                    else {
                        alert('添加失败!')
                    }
                }
            })
        }
        $('.submit').click(sendReq);
    })()

</script>

</body>
</html>